package com.yanqu.road.server.manger.config;

import com.yanqu.road.entity.player.UserPatrons;

import java.math.BigDecimal;

/**
 * 门客计算赚钱用的基础参数
 */
public class PatronsAbilityCalcBaseParams {
    private UserPatrons userPatrons;
    private int quality; //品质
    private long qualification; //总资质
    private long keepSakeQualification; //羁绊资质
    private BigDecimal calcAbilityParam = BigDecimal.ZERO; //每点资质基础赚钱
    private BigDecimal abilityAdditionRatio = BigDecimal.ZERO; //千分比加成

    private String printfStr; //打印用的字符串

    public PatronsAbilityCalcBaseParams(UserPatrons userPatrons, int quality, long qualification, long keepSakeAddition, BigDecimal calcAbilityParam, BigDecimal abilityAdditionRatio) {
        this.userPatrons = userPatrons;
        this.quality = quality;
        this.qualification = qualification;
        this.keepSakeQualification = keepSakeAddition;
        this.calcAbilityParam = calcAbilityParam;
        this.abilityAdditionRatio = abilityAdditionRatio;
    }

    public long getTotalQualification() {
        return qualification + keepSakeQualification;
    }

    public UserPatrons getUserPatrons() {
        return userPatrons;
    }

    public int getQuality() {
        return quality;
    }

    public long getQualification() {
        return qualification;
    }

    public long getKeepSakeQualification() {
        return keepSakeQualification;
    }

    public BigDecimal getCalcAbilityParam() {
        return calcAbilityParam;
    }

    public BigDecimal getAbilityAdditionRatio() {
        return abilityAdditionRatio;
    }

    /**
     * 未算加成前的基础赚钱能力,就是总资质乘每点资质基础赚钱
     * @return
     */
    public BigDecimal calcBaseAbility() {
        return BigDecimal.valueOf(getTotalQualification()).multiply(calcAbilityParam);
    }

    public String getPrintfStr() {
        return printfStr;
    }

    public void setPrintfStr(String printfStr) {
        this.printfStr = printfStr;
    }
}
